import React from 'react'
import RecordTable from './module/recordTable'
import TeacherTable from './module/teacherTable'

import {Button} from 'antd';


export default class TeacherSerch extends React.Component{
    constructor(props){
        super(props);
        this.state={
            content:null
        };

        this.changeToRecordTable = this.changeToRecordTable.bind(this);
        this.changeToTeacherTable = this.changeToTeacherTable.bind(this);
    }

    componentDidMount(){
        this.changeToTeacherTable();
    }

    componentWillUnmount(){

    }

    changeToRecordTable(stuId) {
        this.setState({
            content:
                <div>
                    <Button onClick={()=>{this.changeToTeacherTable()}} style={{marginBottom:20}}>返回</Button>
                    <RecordTable stuId={stuId} changeBackTable={this.changeToTeacherTable}/>
                </div>
        });
    }

    changeToTeacherTable(){
        this.setState({
            content: <TeacherTable changeTable={this.changeToRecordTable}/>
        })
    }

    render(){
        return (
            this.state.content
            //<RecordTable stuId={1}/>
        )
    }
}